/**
 * Created by 001 on 2017/11/8.
 */
//播放列表
import React from 'react'
import MusiclistItem from '../components/musiclistItem'
import { Link } from 'react-router';

let Musiclist = React.createClass({
    getInitialState(){
        return {}
    },
    componentDidMount(){

    },
    //在部件销毁时候解绑事件
    componentWillUnMount(){
    },
    render(){
        let listEle = null;
        listEle = this.props.musicList.map((item)=> {
            return (
                <MusiclistItem
                    focus={item === this.props.currentMusicItem}
                    key={item.id}
                    musicItem={item}
                >
                    {item.title}
                </MusiclistItem>
            );
        });

        return (
            <div>
                <h1><Link to="/">返回</Link></h1>
                <ul>
                    {listEle}
                </ul>
            </div>
        );
    }
});

export default Musiclist;